function getToken() {
  const token = uni.getStorageSync('token');
  if (token == "" || token == null) {
    uni.reLaunch({
      url: '/pages/login/index'
    });
  }
  return token;
}

function removeToken() {
  uni.removeStorageSync('token');
}

function getUserInfo() {
  const userInfo = uni.getStorageSync('userInfo');
  if (userInfo == "" || userInfo == null) {
    uni.reLaunch({
      url: '/pages/login/index'
    });
  }
  return userInfo;
}


module.exports = {
  getToken: getToken,
  removeToken: removeToken,
  getUserInfo: getUserInfo
};
